package com.tools.web.email.template;

import com.tools.common.object.Note;

/**
 * 邮箱模板包装类
 * 对应路径是 classpath:template/email/EmailCaptchaTemplate2.html
 * */
@Note("邮箱模板的默认包装类。" +
        "对应路径是 classpath:template/email/EmailCaptchaTemplate2.html")
public class EmailCaptchaTemplate2 {

    public static final String T1 = "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">" +
            "<style>" +
            "body{font-family: Arial,sans-serif;background-color: #f2f2f2;padding: 10px;}" +
            ".container {max-width: 500px;margin: auto;border: 1px solid #ccc;padding: 20px;text-align: center;background-color: white;}" +
            "h1{color: #337ab7;}" +
            "p{line-height: 1.5;}" +
            "</style></head>" +
            "<body><div class=\"container\"><h1>";

    public static final String T2 = "</h1><p>请在 ";

    public static final String T3 = "内使用以下验证码完成您的";

    public static final String T4 = "操作</p><p><strong>你的验证码:</strong></p><p style=\"font-size:24px;\">";

    public static final String T5 = "</p><p>若非您本人的操作请忽视此信息，请不要回复或转发它，以免带来不必要的信息泄露风险。</p></div></body></html>";


    @Note("根据传入的参数生成邮箱验证码的 HTML 模板")
    public static String buildCaptcha(String sendAlias, String actionName, String expiration, String captcha) {
        return T1 + sendAlias + T2 + expiration + T3 + actionName + T4 + captcha + T5;
    }
}
